<template>
  <view class="header">
    <view class="header-back">
     <u-icon name="arrow-left" color="#fff" size="20" @click="goback" v-if="showBack"></u-icon>
    </view>
    <view class="header-title">{{title}}</view>
    <view class="header-search">
     <u-icon name="search" color="#fff" size="25" @click="search" v-if="showSearch"></u-icon>
    </view>
  </view>
</template>

<script>
  export default{
    name: "pit-header",
    props:{
      title:{
        type:String
      },
      showBack: {
        type: Boolean,
        default: true
      },
      showSearch: {
        type: Boolean,
        default: false
      },
    },
    data(){
      return{
      }
    },
    methods:{
      goback(){
        uni.navigateBack();
      }
    }
  }
</script>

<style lang="scss" scoped>
  .header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    background-color: rgb(31, 81, 154);
    padding: 30px 20px 13px 20px;
    .header-title {
      font-size: 18px;
      font-weight: 550;
      color: white;
    }
  }
</style>
